Component({
  data: {
    selectText: '',
    selectValue: "",
    dictList: [],
    dictKey: ''
  },

  methods: {
    onColumnChange(e) {
      console.log('picker pick:', e);
    },

    onPickerChange(e) {
      const { key } = e.currentTarget.dataset;
      const { value } = e.detail;
      const { label } = e.detail;
      // console.log('picker change:', e.detail,e);
      this.setData({
        [`${key}Visible`]: false,
        [`${key}Value`]: value.join(' '),
        [`${key}Text`]: label.join(' '),
      });
    },

    onPickerCancel(e) {
      const { key } = e.currentTarget.dataset;
      // console.log(e, '取消');
      // console.log('picker1 cancel:');
      this.setData({
        [`${key}Visible`]: false,
      });
    },

    onDictPicker() {
      this.setData({ selectVisible: true });
    },

    onChildClick(e) {
      this.triggerEvent('click', this.data);
    }
  },
  
  properties: {
    dictList: Array,
    titleName: String
  }

});
